﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NasuTek.Shion.Extencibility;
using System.Windows.Forms;

namespace Shion.OperPlugin
{
    public class Plugin : IPlugin
    {
        #region IPlugin Members

        public void Load(ExtencibilityManager e)
        {
            e.Plugins.Add("IrcOpScript", new ExtencibilityManager.PluginData("IRCOp Script",
                "(C) 2009 NasuTek Systems",
                "NasuTek Systems",
                "Gives IRCOp's basic IRCOp commands in a simple menu",
                GetType().Assembly.GetName().Version));

            e.OnRaw.Add("statsraw", new StatsRawCapture());
            e.OnRaw.Add("operraws", new OperRawCapture());
            new OperScript(e);
        }

        #endregion
    }

    public class OperScript
    {
        ExtencibilityManager em;
        static IniFile ini = new IniFile("plugins\\network.ini");

        string banmessage = String.Format("If you wish to appeal this ban, visit {0} )", ini.IniReadValue("Network", "banaddress"));
        string banflood = String.Format("Flooding is bad mmkay", "");
        string banspambot = String.Format("Spam/Trojan/DCC Bots are not permitted on {0}.", ini.IniReadValue("Network", "networkname"));
        string banattitude = String.Format("You have displayed conduct that is not suitable for the {0} environment.", ini.IniReadValue("Network", "networkname"));
        string banevasion = String.Format("Attempting to evade a ban is a serious infraction and only results in a longer ban!", "");
        string banspeech = String.Format("Hate speech is NOT tolerated on {0}.", ini.IniReadValue("Network", "networkname"));
        string banpmflood = String.Format("Don't PM/Query/DCC/CTCP or /invite anyone without first asking their permission in the channel.", "");
        string banporn = String.Format("Inappropriate or pornographic links displayed in public channels are not tolerated here.", "");
        string banproxy = String.Format("The use of an open proxy to connect to the network is not allowed.", "");
        string killamsg = String.Format("AMSGs considered to be spam are not allowed.", "");
        string dontban = String.Format("{0} staff may not be banned from any channel on this network!", ini.IniReadValue("Network", "networkname"));
        string nodesync = String.Format("Bots should not kick or ban for Abusing desync on {0}.", ini.IniReadValue("Network", "networkname"));
        string nodesyncwallchop = String.Format("Bots should not kick or ban for Abusing desync on {0}. Please change your eggdrop settings to: \"chanset  -nodesynch\" and then join {2} or post to {1} to have the shun on your bot removed.", ini.IniReadValue("Network", "networkname"), ini.IniReadValue("Network", "banaddress"), ini.IniReadValue("Network", "helpchannel"));
        string dontkick = String.Format("{0} staff may not be kicked from any channel on this network!", ini.IniReadValue("Network", "networkname"));

        public OperScript(ExtencibilityManager e)
        {
            em = e;

            ToolStripMenuItem OperMenu = new ToolStripMenuItem("Oper Menu");
            #region Modes and Changes
            ToolStripMenuItem ModesAndChanges = new ToolStripMenuItem("Modes and Changes");
            ToolStripMenuItem SetHost = new ToolStripMenuItem("SetHost");
            SetHost.Click += new EventHandler(SetHost_Click);
            ToolStripMenuItem SetIdent = new ToolStripMenuItem("SetIdent");
            SetIdent.Click += new EventHandler(SetIdent_Click);
            ToolStripMenuItem CHGhost = new ToolStripMenuItem("CHGhost");
            CHGhost.Click += new EventHandler(CHGhost_Click);
            ToolStripMenuItem chgname = new ToolStripMenuItem("chgname");
            chgname.Click += new EventHandler(chgname_Click);
            ToolStripMenuItem chgIdent = new ToolStripMenuItem("chgIdent");
            chgIdent.Click += new EventHandler(chgIdent_Click);

            ModesAndChanges.DropDownItems.Add(SetHost);
            ModesAndChanges.DropDownItems.Add(SetIdent);
            ModesAndChanges.DropDownItems.Add(CHGhost);
            ModesAndChanges.DropDownItems.Add(chgname);
            ModesAndChanges.DropDownItems.Add(chgIdent);
            OperMenu.DropDownItems.Add(ModesAndChanges);
            #endregion
            #region User Kills
            ToolStripMenuItem UserKills = new ToolStripMenuItem("UserKills");
            #region Shun
            ToolStripMenuItem Shun = new ToolStripMenuItem("Shun");
            #region Hostmask
            ToolStripMenuItem Hostmask = new ToolStripMenuItem("Hostmask");
            ToolStripMenuItem FloodH = new ToolStripMenuItem("Flood");
            FloodH.Click += new EventHandler(FloodH_Click);
            ToolStripMenuItem SpamBotsTrojansH = new ToolStripMenuItem("Spam/Bots/Trojans");
            SpamBotsTrojansH.Click += new EventHandler(SpamBotsTrojansH_Click);
            ToolStripMenuItem AttitudeH = new ToolStripMenuItem("Attitude");
            AttitudeH.Click += new EventHandler(AttitudeH_Click);
            ToolStripMenuItem BanEvasionH = new ToolStripMenuItem("Ban Evasion");
            BanEvasionH.Click += new EventHandler(BanEvasionH_Click);
            ToolStripMenuItem HateSpeechH = new ToolStripMenuItem("Hate speech");
            HateSpeechH.Click += new EventHandler(HateSpeechH_Click);
            ToolStripMenuItem PMSpamH = new ToolStripMenuItem("PM Spam");
            PMSpamH.Click += new EventHandler(PMSpamH_Click);
            ToolStripMenuItem OtherReasonH = new ToolStripMenuItem("Other reason");
            OtherReasonH.Click += new EventHandler(OtherReasonH_Click);
            Hostmask.DropDownItems.Add(FloodH);
            Hostmask.DropDownItems.Add(SpamBotsTrojansH);
            Hostmask.DropDownItems.Add(AttitudeH);
            Hostmask.DropDownItems.Add(BanEvasionH);
            Hostmask.DropDownItems.Add(HateSpeechH);
            Hostmask.DropDownItems.Add(PMSpamH);
            Hostmask.DropDownItems.Add(OtherReasonH);
            Shun.DropDownItems.Add(Hostmask);
            #endregion
            #region Other Hostmask
            ToolStripMenuItem OtherHostmask = new ToolStripMenuItem("Other hostmask");
            ToolStripMenuItem FloodO = new ToolStripMenuItem("Flood");
            FloodO.Click += new EventHandler(FloodO_Click);
            ToolStripMenuItem SpamBotsTrojansO = new ToolStripMenuItem("Spam/Bots/Trojans");
            SpamBotsTrojansO.Click += new EventHandler(SpamBotsTrojansO_Click);
            ToolStripMenuItem AttitudeO = new ToolStripMenuItem("Attitude");
            AttitudeO.Click += new EventHandler(AttitudeO_Click);
            ToolStripMenuItem BanEvasionO = new ToolStripMenuItem("Ban Evasion");
            BanEvasionO.Click += new EventHandler(BanEvasionO_Click);
            ToolStripMenuItem HateSpeechO = new ToolStripMenuItem("Hate speech");
            HateSpeechO.Click += new EventHandler(HateSpeechO_Click);
            ToolStripMenuItem PMSpamO = new ToolStripMenuItem("PM Spam");
            PMSpamO.Click += new EventHandler(PMSpamO_Click);
            ToolStripMenuItem OtherReasonO = new ToolStripMenuItem("Other reason");
            OtherReasonO.Click += new EventHandler(OtherReasonO_Click);

            OtherHostmask.DropDownItems.Add(FloodO);
            OtherHostmask.DropDownItems.Add(SpamBotsTrojansO);
            OtherHostmask.DropDownItems.Add(AttitudeO);
            OtherHostmask.DropDownItems.Add(BanEvasionO);
            OtherHostmask.DropDownItems.Add(HateSpeechO);
            OtherHostmask.DropDownItems.Add(PMSpamO);
            OtherHostmask.DropDownItems.Add(OtherReasonO);
            Shun.DropDownItems.Add(OtherHostmask);
            #endregion
            UserKills.DropDownItems.Add(Shun);
            #endregion
            #region Kill
            ToolStripMenuItem Kill = new ToolStripMenuItem("Kill");
            #region Hostmask
            ToolStripMenuItem KillHostmask = new ToolStripMenuItem("Hostmask");

            ToolStripMenuItem KillFloodH = new ToolStripMenuItem("Flood"); //:/kill $1 %geeksbanflood
            KillFloodH.Click += new EventHandler(KillFloodH_Click);
            ToolStripMenuItem KillSpamBotsTrojansH = new ToolStripMenuItem("Spam/Bots/Trojans"); //:/kill $1 %geeksbanspambot
            KillSpamBotsTrojansH.Click += new EventHandler(KillSpamBotsTrojansH_Click);
            ToolStripMenuItem KillAttitudeH = new ToolStripMenuItem("Attitude"); //:/kill $1 %geeksbanattitude
            KillAttitudeH.Click += new EventHandler(KillAttitudeH_Click);
            ToolStripMenuItem KillBanEvasionH = new ToolStripMenuItem("Ban Evasion"); //:/kill $1 %geeksbanevasion
            KillBanEvasionH.Click += new EventHandler(KillBanEvasionH_Click);
            ToolStripMenuItem KillHatespeechH = new ToolStripMenuItem("Hate speech"); //:/kill $1 %geeksbanspeech
            KillHatespeechH.Click += new EventHandler(KillHatespeechH_Click);
            ToolStripMenuItem KillPMSpamH = new ToolStripMenuItem("PM Spam"); //:/kill $1 %geeksbanpmflood
            KillPMSpamH.Click += new EventHandler(KillPMSpamH_Click);
            ToolStripMenuItem KillAmsgH = new ToolStripMenuItem("Amsg"); //:/kill $1 %geekskillamsg
            KillAmsgH.Click += new EventHandler(KillAmsgH_Click);
            ToolStripMenuItem KillProxiesH = new ToolStripMenuItem("Proxies"); //:/kill $1 %geeksbanproxy
            KillProxiesH.Click += new EventHandler(KillProxiesH_Click);
            ToolStripMenuItem KillOtherReasonH = new ToolStripMenuItem("Other reason"); //:/kill $1 $$?="Reason:"
            KillOtherReasonH.Click += new EventHandler(KillOtherReasonH_Click);

            KillHostmask.DropDownItems.Add(KillFloodH);
            KillHostmask.DropDownItems.Add(KillSpamBotsTrojansH);
            KillHostmask.DropDownItems.Add(KillAttitudeH);
            KillHostmask.DropDownItems.Add(KillBanEvasionH);
            KillHostmask.DropDownItems.Add(KillHatespeechH);
            KillHostmask.DropDownItems.Add(KillPMSpamH);
            KillHostmask.DropDownItems.Add(KillAmsgH);
            KillHostmask.DropDownItems.Add(KillProxiesH);
            KillHostmask.DropDownItems.Add(KillOtherReasonH);
            Kill.DropDownItems.Add(KillHostmask);
            #endregion
            #region Other Hostmask
            ToolStripMenuItem KillOther = new ToolStripMenuItem("Other Hostmask");

            ToolStripMenuItem KillFloodO = new ToolStripMenuItem("Flood"); //:/kill $1 %geeksbanflood
            KillFloodO.Click += new EventHandler(KillFloodO_Click);
            ToolStripMenuItem KillSpamBotsTrojansO = new ToolStripMenuItem("Spam/Bots/Trojans"); //:/kill $1 %geeksbanspambot
            KillSpamBotsTrojansO.Click += new EventHandler(KillSpamBotsTrojansO_Click);
            ToolStripMenuItem KillAttitudeO = new ToolStripMenuItem("Attitude"); //:/kill $1 %geeksbanattitude
            KillAttitudeO.Click += new EventHandler(KillAttitudeO_Click);
            ToolStripMenuItem KillBanEvasionO = new ToolStripMenuItem("Ban Evasion"); //:/kill $1 %geeksbanevasion
            KillBanEvasionO.Click += new EventHandler(KillBanEvasionO_Click);
            ToolStripMenuItem KillHatespeechO = new ToolStripMenuItem("Hate speech"); //:/kill $1 %geeksbanspeech
            KillHatespeechO.Click += new EventHandler(KillHatespeechO_Click);
            ToolStripMenuItem KillPMSpamO = new ToolStripMenuItem("PM Spam"); //:/kill $1 %geeksbanpmflood
            KillPMSpamO.Click += new EventHandler(KillPMSpamO_Click);
            ToolStripMenuItem KillAmsgO = new ToolStripMenuItem("Amsg"); //:/kill $1 %geekskillamsg
            KillAmsgO.Click += new EventHandler(KillAmsgO_Click);
            ToolStripMenuItem KillProxiesO = new ToolStripMenuItem("Proxies"); //:/kill $1 %geeksbanproxy
            KillProxiesO.Click += new EventHandler(KillProxiesO_Click);
            ToolStripMenuItem KillOtherReasonO = new ToolStripMenuItem("Other reason"); //:/kill $1 $$?="Reason:"
            KillOtherReasonO.Click += new EventHandler(KillOtherReasonO_Click);

            KillOther.DropDownItems.Add(KillFloodO);
            KillOther.DropDownItems.Add(KillSpamBotsTrojansO);
            KillOther.DropDownItems.Add(KillAttitudeO);
            KillOther.DropDownItems.Add(KillBanEvasionO);
            KillOther.DropDownItems.Add(KillHatespeechO);
            KillOther.DropDownItems.Add(KillPMSpamO);
            KillOther.DropDownItems.Add(KillAmsgO);
            KillOther.DropDownItems.Add(KillProxiesO);
            KillOther.DropDownItems.Add(KillOtherReasonO);
            Kill.DropDownItems.Add(KillOther);
            #endregion
            UserKills.DropDownItems.Add(Kill);
            #endregion
            #region Gline
            ToolStripMenuItem GLine = new ToolStripMenuItem("Gline");
            #region Hostmask
            ToolStripMenuItem GLineHostmask = new ToolStripMenuItem("Hostmask");
            ToolStripMenuItem GLineFloodH = new ToolStripMenuItem("Flood"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanflood %geeksbanmessage
            ToolStripMenuItem GLineSpamBotsTrojansH = new ToolStripMenuItem("Spam/Bots/Trojans"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanspambot %geeksbanmessage
            ToolStripMenuItem GLineAttitudeH = new ToolStripMenuItem("Attitude"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanattitude %geeksbanmessage
            ToolStripMenuItem GLineBanEvasionH = new ToolStripMenuItem("Ban Evasion"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanevasion %geeksbanmessage
            ToolStripMenuItem GLineHatespeechH = new ToolStripMenuItem("Hate speech"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanspeech %geeksbanmessage
            ToolStripMenuItem GLinePMSpamH = new ToolStripMenuItem("PM Spam"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanpmflood %geeksbanmessage
            ToolStripMenuItem GLinePornlinksH = new ToolStripMenuItem("Porn links"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanporn %geeksbanmessage
            ToolStripMenuItem GLineProxiesH = new ToolStripMenuItem("Proxies"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanproxy %geeksbanmessage
            ToolStripMenuItem GLineOtherreasonH = new ToolStripMenuItem("Other reason"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" $$?="Reason:" %geeksbanmessage
            GLineHostmask.DropDownItems.Add(GLineFloodH);
            GLineHostmask.DropDownItems.Add(GLineSpamBotsTrojansH);
            GLineHostmask.DropDownItems.Add(GLineAttitudeH);
            GLineHostmask.DropDownItems.Add(GLineBanEvasionH);
            GLineHostmask.DropDownItems.Add(GLineHatespeechH);
            GLineHostmask.DropDownItems.Add(GLinePornlinksH);
            GLineHostmask.DropDownItems.Add(GLineProxiesH);
            GLineHostmask.DropDownItems.Add(GLineOtherreasonH);
            GLine.DropDownItems.Add(GLineHostmask);
            #endregion
            #region Other Hostmask
            ToolStripMenuItem GLineOtherHostmask = new ToolStripMenuItem("Hostmask");
            ToolStripMenuItem GLineFloodO = new ToolStripMenuItem("Flood"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanflood %geeksbanmessage
            ToolStripMenuItem GLineSpamBotsTrojansO = new ToolStripMenuItem("Spam/Bots/Trojans"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanspambot %geeksbanmessage
            ToolStripMenuItem GLineAttitudeO = new ToolStripMenuItem("Attitude"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanattitude %geeksbanmessage
            ToolStripMenuItem GLineBanEvasionO = new ToolStripMenuItem("Ban Evasion"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanevasion %geeksbanmessage
            ToolStripMenuItem GLineHatespeechO = new ToolStripMenuItem("Hate speech"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanspeech %geeksbanmessage
            ToolStripMenuItem GLinePMSpamO = new ToolStripMenuItem("PM Spam"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanpmflood %geeksbanmessage
            ToolStripMenuItem GLinePornlinksO = new ToolStripMenuItem("Porn links"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanporn %geeksbanmessage
            ToolStripMenuItem GLineProxiesO = new ToolStripMenuItem("Proxies"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanproxy %geeksbanmessage
            ToolStripMenuItem GLineOtherreasonO = new ToolStripMenuItem("Other reason"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" $$?="Reason:" %geeksbanmessage
            GLineOtherHostmask.DropDownItems.Add(GLineFloodO);
            GLineOtherHostmask.DropDownItems.Add(GLineSpamBotsTrojansO);
            GLineOtherHostmask.DropDownItems.Add(GLineAttitudeO);
            GLineOtherHostmask.DropDownItems.Add(GLineBanEvasionO);
            GLineOtherHostmask.DropDownItems.Add(GLineHatespeechO);
            GLineOtherHostmask.DropDownItems.Add(GLinePornlinksO);
            GLineOtherHostmask.DropDownItems.Add(GLineProxiesO);
            GLineOtherHostmask.DropDownItems.Add(GLineOtherreasonO);
            GLine.DropDownItems.Add(GLineOtherHostmask);
            #endregion
            UserKills.DropDownItems.Add(GLine);
            #endregion
            #region GZline
            ToolStripMenuItem GZLine = new ToolStripMenuItem("GZline");
            #region Hostmask
            ToolStripMenuItem GZLineHostmask = new ToolStripMenuItem("Hostmask");
            ToolStripMenuItem GZLineFloodH = new ToolStripMenuItem("Flood"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanflood %geeksbanmessage
            ToolStripMenuItem GZLineSpamBotsTrojansH = new ToolStripMenuItem("Spam/Bots/Trojans"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanspambot %geeksbanmessage
            ToolStripMenuItem GZLineAttitudeH = new ToolStripMenuItem("Attitude"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanattitude %geeksbanmessage
            ToolStripMenuItem GZLineBanEvasionH = new ToolStripMenuItem("Ban Evasion"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanevasion %geeksbanmessage
            ToolStripMenuItem GZLineHatespeechH = new ToolStripMenuItem("Hate speech"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanspeech %geeksbanmessage
            ToolStripMenuItem GZLinePMSpamH = new ToolStripMenuItem("PM Spam"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanpmflood %geeksbanmessage
            ToolStripMenuItem GZLinePornlinksH = new ToolStripMenuItem("Porn links"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanporn %geeksbanmessage
            ToolStripMenuItem GZLineProxiesH = new ToolStripMenuItem("Proxies"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanproxy %geeksbanmessage
            ToolStripMenuItem GZLineOtherreasonH = new ToolStripMenuItem("Other reason"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" $$?="Reason:" %geeksbanmessage
            GZLineHostmask.DropDownItems.Add(GZLineFloodH);
            GZLineHostmask.DropDownItems.Add(GZLineSpamBotsTrojansH);
            GZLineHostmask.DropDownItems.Add(GZLineAttitudeH);
            GZLineHostmask.DropDownItems.Add(GZLineBanEvasionH);
            GZLineHostmask.DropDownItems.Add(GZLineHatespeechH);
            GZLineHostmask.DropDownItems.Add(GZLinePornlinksH);
            GZLineHostmask.DropDownItems.Add(GZLineProxiesH);
            GZLineHostmask.DropDownItems.Add(GZLineOtherreasonH);
            GZLine.DropDownItems.Add(GZLineHostmask);
            #endregion
            #region Other Hostmask
            ToolStripMenuItem GZLineOtherHostmask = new ToolStripMenuItem("Hostmask");
            ToolStripMenuItem GZLineFloodO = new ToolStripMenuItem("Flood"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanflood %geeksbanmessage
            ToolStripMenuItem GZLineSpamBotsTrojansO = new ToolStripMenuItem("Spam/Bots/Trojans"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanspambot %geeksbanmessage
            ToolStripMenuItem GZLineAttitudeO = new ToolStripMenuItem("Attitude"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanattitude %geeksbanmessage
            ToolStripMenuItem GZLineBanEvasionO = new ToolStripMenuItem("Ban Evasion"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanevasion %geeksbanmessage
            ToolStripMenuItem GZLineHatespeechO = new ToolStripMenuItem("Hate speech"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanspeech %geeksbanmessage
            ToolStripMenuItem GZLinePMSpamO = new ToolStripMenuItem("PM Spam"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanpmflood %geeksbanmessage
            ToolStripMenuItem GZLinePornlinksO = new ToolStripMenuItem("Porn links"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanporn %geeksbanmessage
            ToolStripMenuItem GZLineProxiesO = new ToolStripMenuItem("Proxies"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" %geeksbanproxy %geeksbanmessage
            ToolStripMenuItem GZLineOtherreasonO = new ToolStripMenuItem("Other reason"); //:/gline $1 $$?="Ban Time (2w,3d,60m,30s):" $$?="Reason:" %geeksbanmessage
            GZLineOtherHostmask.DropDownItems.Add(GZLineFloodO);
            GZLineOtherHostmask.DropDownItems.Add(GZLineSpamBotsTrojansO);
            GZLineOtherHostmask.DropDownItems.Add(GZLineAttitudeO);
            GZLineOtherHostmask.DropDownItems.Add(GZLineBanEvasionO);
            GZLineOtherHostmask.DropDownItems.Add(GZLineHatespeechO);
            GZLineOtherHostmask.DropDownItems.Add(GZLinePornlinksO);
            GZLineOtherHostmask.DropDownItems.Add(GZLineProxiesO);
            GZLineOtherHostmask.DropDownItems.Add(GZLineOtherreasonO);
            GZLine.DropDownItems.Add(GZLineOtherHostmask);
            #endregion
            UserKills.DropDownItems.Add(GZLine);
            #endregion
            OperMenu.DropDownItems.Add(UserKills);
            #endregion
            #region Server Admin
            /*
             *       .ServerAdmin(DANGER)
      ..DCCDeny:/dccdeny $$?="Filename mask and reason:"
      ..UnDCCDeny:/undccdeny $$?="Filename mask:"
      ..EncryptedPasswords
      ...Crypt:/mkpasswd crypt $$?="Password:"
      ...Sha1SSL:/mkpasswd sha1 $$?="Password:"
      ...MD5SSL:/mkpasswd md5 $$?="Password:"
      .-*/
            #endregion
            #region Server Stats
            ToolStripMenuItem stats = new ToolStripMenuItem("Stats");
            stats.Click += new EventHandler(stats_Click);
            OperMenu.DropDownItems.Add(stats);
            #endregion
            #region Server Performance and Info
            ShionMenuItem spai = new ShionMenuItem("Server Performance and Info", OperMenu);
            new ShionMenuItem(em, "Trace", "/trace $$?=(Server Name)", spai);
            new ShionMenuItem(em, "Lag", "/lag $$?=(Server Name:)", spai);
            new ShionMenuItem(em, "Links", "/links", spai);
            new ShionMenuItem(em, "Version", "/version", spai);
            new ShionMenuItem(em, "Map", "/map", spai);
            new ShionMenuItem(em, "Rules", "/rules", spai);
            new ShionMenuItem(em, "AdminList", "/admin $$?=(Server Name)", spai);
            #endregion
            #region User and Channel Info Modes
            ShionMenuItem uacim = new ShionMenuItem("UserMode", OperMenu);
            ShionMenuItem uacim_um = new ShionMenuItem(em, "UserMode", "/helpop ?umodes", uacim);
            ShionMenuItem uacim_cm = new ShionMenuItem(em, "ChannelMode", "/helpop ?chmodes", uacim);
            #endregion
            #region OperServ (All Uses Logged)
            ShionMenuItem operserv = new ShionMenuItem("Server Performance and Info", OperMenu);
            new ShionMenuItem(em, "GlobalMessage", "/msg operserv global $$?=(Message for all channels:)", operserv);
            new ShionMenuItem(em, "Stats", "/msg operserv stats", operserv);
            new ShionMenuItem(em, "Op List", "/msg operserv oper list", operserv);
            new ShionMenuItem(em, "Admin List", "/msg operserv admin list", operserv);
            new ShionMenuItem(em, "Staff", "/msg operserv staff", operserv);
            ShionMenuItem news = new ShionMenuItem("News", operserv);
            new ShionMenuItem(em, "Logon News", "/msg operserv logonnews add $$?=(Enter Logon Msg:  Only the most recent 3 items will be sent.)", news);
            new ShionMenuItem(em, "Random News", "/msg operserv randomnews add $$?=(Enter Random Entry Msg:)", news);
            new ShionMenuItem(em, "Oper News", "/msg operserv opernews add $$?=(Enter Oper News:  Only the most recent 3 items will be sent.)", news);
            new ShionMenuItem(em, "Chankill (Akills all users on Chan)", "/msg operserv chankill $$?=(Enter Channel) $$?=(Enter Reason)", operserv);
            ShionMenuItem superadmin = new ShionMenuItem("SuperAdmin", operserv);
            new ShionMenuItem(em, "On", "/msg operserv set superadmin on", superadmin);
            new ShionMenuItem(em, "Off", "/msg operserv set superadmin off", superadmin);
            new ShionMenuItem(em, "Kill Clones", "/msg operserv killclones $$?=(Enter Nick:)", operserv);
            new ShionMenuItem(em, "Session Exceptions", "/msg operserv exception add $$?=(Enter Host: Portion after @) $$?=(Enter # of Sessions:) $$?=(Enter Reason:)", operserv);
            #endregion
            e.NickMenu.Items.Add(OperMenu);
        }

        #region Server Stats
        void stats_Click(object sender, EventArgs e)
        {
            new Stats(em).ShowDialog();
        }
        #endregion
        #region User Kills
        #region Shun
        #region Hostmask
        void OtherReasonH_Click(object sender, EventArgs e)
        {
            GetDialog getText = new GetDialog("Reason:");
            GetDialog getTextTime = new GetDialog("Shun Time (2w,3d,60m,30s):");
            if (getText.ShowDialog() == DialogResult.OK)
            {
                if (getTextTime.ShowDialog() == DialogResult.OK)
                {
                    foreach (ListViewItem i in em.NickListView.SelectedItems)
                    {
                        em.Clients[em.activeServer].WriteLine("shun " + i.Text + " " + getText.Answer);
                    }
                }
            }
        }

        void PMSpamH_Click(object sender, EventArgs e)
        {
            GetDialog getTextTime = new GetDialog("Shun Time (2w,3d,60m,30s):");

            if (getTextTime.ShowDialog() == DialogResult.OK)
            {
                foreach (ListViewItem i in em.NickListView.SelectedItems)
                {
                    em.Clients[em.activeServer].WriteLine("shun " + i.Text + " " + getTextTime.Answer + " " + this.banpmflood);
                }
            }
        }

        void HateSpeechH_Click(object sender, EventArgs e)
        {
            GetDialog getTextTime = new GetDialog("Shun Time (2w,3d,60m,30s):");

            if (getTextTime.ShowDialog() == DialogResult.OK)
            {
                foreach (ListViewItem i in em.NickListView.SelectedItems)
                {
                    em.Clients[em.activeServer].WriteLine("shun " + i.Text + " " + getTextTime.Answer + " " + this.banspeech);
                }
            }
        }

        void BanEvasionH_Click(object sender, EventArgs e)
        {
            GetDialog getTextTime = new GetDialog("Shun Time (2w,3d,60m,30s):");

            if (getTextTime.ShowDialog() == DialogResult.OK)
            {
                foreach (ListViewItem i in em.NickListView.SelectedItems)
                {
                    em.Clients[em.activeServer].WriteLine("shun " + i.Text + " " + getTextTime.Answer + " " + this.banevasion);
                }
            }
        }

        void AttitudeH_Click(object sender, EventArgs e)
        {
            GetDialog getTextTime = new GetDialog("Shun Time (2w,3d,60m,30s):");

            if (getTextTime.ShowDialog() == DialogResult.OK)
            {
                foreach (ListViewItem i in em.NickListView.SelectedItems)
                {
                    em.Clients[em.activeServer].WriteLine("shun " + i.Text + " " + getTextTime.Answer + " " + this.banattitude);
                }
            }
        }

        void SpamBotsTrojansH_Click(object sender, EventArgs e)
        {
            GetDialog getTextTime = new GetDialog("Shun Time (2w,3d,60m,30s):");

            if (getTextTime.ShowDialog() == DialogResult.OK)
            {
                foreach (ListViewItem i in em.NickListView.SelectedItems)
                {
                    em.Clients[em.activeServer].WriteLine("shun " + i.Text + " " + getTextTime.Answer + " " + this.banspambot);
                }
            }
        }

        void FloodH_Click(object sender, EventArgs e)
        {
            GetDialog getTextTime = new GetDialog("Shun Time (2w,3d,60m,30s):");

            if (getTextTime.ShowDialog() == DialogResult.OK)
            {
                foreach (ListViewItem i in em.NickListView.SelectedItems)
                {
                    em.Clients[em.activeServer].WriteLine("shun " + i.Text + " " + getTextTime.Answer + " " + this.banflood);
                }
            }
        }
        #endregion
        #region Other Hostmask
        void OtherReasonO_Click(object sender, EventArgs e)
        {
            GetDialog getText = new GetDialog("Reason:");
            GetDialog getTextHostmask = new GetDialog("Hostmask:");
            GetDialog getTextTime = new GetDialog("Shun Time (2w,3d,60m,30s):");
            if (getText.ShowDialog() == DialogResult.OK)
            {
                if (getTextTime.ShowDialog() == DialogResult.OK)
                {
                    if (getTextHostmask.ShowDialog() == DialogResult.OK)
                    {
                        em.Clients[em.activeServer].WriteLine("shun " + getTextHostmask.Answer + " " + getTextTime.Answer + " " + getText.Answer);
                    }
                }
            }
        }

        void PMSpamO_Click(object sender, EventArgs e)
        {
            GetDialog getTextHostmask = new GetDialog("Hostmask:");
            GetDialog getTextTime = new GetDialog("Shun Time (2w,3d,60m,30s):");
            if (getTextHostmask.ShowDialog() == DialogResult.OK)
            {
                if (getTextTime.ShowDialog() == DialogResult.OK)
                {
                    if (getTextHostmask.ShowDialog() == DialogResult.OK)
                    {
                        em.Clients[em.activeServer].WriteLine("shun " + getTextHostmask.Answer + " " + getTextTime.Answer + " " + this.banpmflood);
                    }
                }
            }
        }

        void HateSpeechO_Click(object sender, EventArgs e)
        {
            GetDialog getTextHostmask = new GetDialog("Hostmask:");
            GetDialog getTextTime = new GetDialog("Shun Time (2w,3d,60m,30s):");
            if (getTextHostmask.ShowDialog() == DialogResult.OK)
            {
                if (getTextTime.ShowDialog() == DialogResult.OK)
                {
                    if (getTextHostmask.ShowDialog() == DialogResult.OK)
                    {
                        em.Clients[em.activeServer].WriteLine("shun " + getTextHostmask.Answer + " " + getTextTime.Answer + " " + this.banspeech);
                    }
                }
            }
        }

        void BanEvasionO_Click(object sender, EventArgs e)
        {
            GetDialog getTextHostmask = new GetDialog("Hostmask:");
            GetDialog getTextTime = new GetDialog("Shun Time (2w,3d,60m,30s):");
            if (getTextHostmask.ShowDialog() == DialogResult.OK)
            {
                if (getTextTime.ShowDialog() == DialogResult.OK)
                {
                    if (getTextHostmask.ShowDialog() == DialogResult.OK)
                    {
                        em.Clients[em.activeServer].WriteLine("shun " + getTextHostmask.Answer + " " + getTextTime.Answer + " " + this.banevasion);
                    }
                }
            }
        }

        void AttitudeO_Click(object sender, EventArgs e)
        {
            GetDialog getTextHostmask = new GetDialog("Hostmask:");
            GetDialog getTextTime = new GetDialog("Shun Time (2w,3d,60m,30s):");
            if (getTextHostmask.ShowDialog() == DialogResult.OK)
            {
                if (getTextTime.ShowDialog() == DialogResult.OK)
                {
                    if (getTextHostmask.ShowDialog() == DialogResult.OK)
                    {
                        em.Clients[em.activeServer].WriteLine("shun " + getTextHostmask.Answer + " " + getTextTime.Answer + " " + this.banattitude);
                    }
                }
            }
        }

        void SpamBotsTrojansO_Click(object sender, EventArgs e)
        {
            GetDialog getTextHostmask = new GetDialog("Hostmask:");
            GetDialog getTextTime = new GetDialog("Shun Time (2w,3d,60m,30s):");
            if (getTextHostmask.ShowDialog() == DialogResult.OK)
            {
                if (getTextTime.ShowDialog() == DialogResult.OK)
                {
                    if (getTextHostmask.ShowDialog() == DialogResult.OK)
                    {
                        em.Clients[em.activeServer].WriteLine("shun " + getTextHostmask.Answer + " " + getTextTime.Answer + " " + this.banspambot);
                    }
                }
            }
        }

        void FloodO_Click(object sender, EventArgs e)
        {
            GetDialog getTextHostmask = new GetDialog("Hostmask:");
            GetDialog getTextTime = new GetDialog("Shun Time (2w,3d,60m,30s):");
            if (getTextHostmask.ShowDialog() == DialogResult.OK)
            {
                if (getTextTime.ShowDialog() == DialogResult.OK)
                {
                    if (getTextHostmask.ShowDialog() == DialogResult.OK)
                    {
                        em.Clients[em.activeServer].WriteLine("shun " + getTextHostmask.Answer + " " + getTextTime.Answer + " " + this.banflood);
                    }
                }
            }
        }
        #endregion
        #endregion
        #region Kills
        #region Hostmask
        void KillOtherReasonH_Click(object sender, EventArgs e)
        {
            GetDialog reason = new GetDialog("Reason:");
            if (reason.ShowDialog() == DialogResult.OK)
            {
                foreach (ListViewItem i in em.NickListView.SelectedItems)
                {
                    em.Clients[em.activeServer].WriteLine("kill " + i.Text + " " + reason.Answer);
                }
            }
        }

        void KillProxiesH_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem i in em.NickListView.SelectedItems)
            {
                em.Clients[em.activeServer].WriteLine("kill " + i.Text + " " + banproxy);
            }
        }

        void KillAmsgH_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem i in em.NickListView.SelectedItems)
            {
                em.Clients[em.activeServer].WriteLine("kill " + i.Text + " " + killamsg);
            }
        }

        void KillPMSpamH_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem i in em.NickListView.SelectedItems)
            {
                em.Clients[em.activeServer].WriteLine("kill " + i.Text + " " + banpmflood);
            }
        }

        void KillHatespeechH_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem i in em.NickListView.SelectedItems)
            {
                em.Clients[em.activeServer].WriteLine("kill " + i.Text + " " + banspeech);
            }
        }

        void KillBanEvasionH_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem i in em.NickListView.SelectedItems)
            {
                em.Clients[em.activeServer].WriteLine("kill " + i.Text + " " + banevasion);
            }
        }

        void KillAttitudeH_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem i in em.NickListView.SelectedItems)
            {
                em.Clients[em.activeServer].WriteLine("kill " + i.Text + " " + banattitude);
            }
        }

        void KillSpamBotsTrojansH_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem i in em.NickListView.SelectedItems)
            {
                em.Clients[em.activeServer].WriteLine("kill " + i.Text + " " + banspambot);
            }
        }

        void KillFloodH_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem i in em.NickListView.SelectedItems)
            {
                em.Clients[em.activeServer].WriteLine("kill " + i.Text + " " + banflood);
            }
        }
        #endregion
        #region Other
        void KillOtherReasonO_Click(object sender, EventArgs e)
        {
            GetDialog reason = new GetDialog("Reason:");
            if (reason.ShowDialog() == DialogResult.OK)
            {
                GetDialog hostmask = new GetDialog("Nick/Hostmask:");
                if (hostmask.ShowDialog() == DialogResult.OK)
                {
                    em.Clients[em.activeServer].WriteLine("kill " + hostmask.Answer + " " + reason.Answer);
                }
            }
        }

        void KillProxiesO_Click(object sender, EventArgs e)
        {
            GetDialog hostmask = new GetDialog("Nick/Hostmask:");
            if (hostmask.ShowDialog() == DialogResult.OK)
            {
                em.Clients[em.activeServer].WriteLine("kill " + hostmask.Answer + " " + banproxy);
            }
        }

        void KillAmsgO_Click(object sender, EventArgs e)
        {
            GetDialog hostmask = new GetDialog("Nick/Hostmask:");
            if (hostmask.ShowDialog() == DialogResult.OK)
            {
                em.Clients[em.activeServer].WriteLine("kill " + hostmask.Answer + " " + killamsg);
            }
        }

        void KillPMSpamO_Click(object sender, EventArgs e)
        {
            GetDialog hostmask = new GetDialog("Nick/Hostmask:");
            if (hostmask.ShowDialog() == DialogResult.OK)
            {
                em.Clients[em.activeServer].WriteLine("kill " + hostmask.Answer + " " + banpmflood);
            }
        }

        void KillHatespeechO_Click(object sender, EventArgs e)
        {
            GetDialog hostmask = new GetDialog("Nick/Hostmask:");
            if (hostmask.ShowDialog() == DialogResult.OK)
            {
                em.Clients[em.activeServer].WriteLine("kill " + hostmask.Answer + " " + banspeech);
            }
        }

        void KillBanEvasionO_Click(object sender, EventArgs e)
        {
            GetDialog hostmask = new GetDialog("Nick/Hostmask:");
            if (hostmask.ShowDialog() == DialogResult.OK)
            {
                em.Clients[em.activeServer].WriteLine("kill " + hostmask.Answer + " " + banevasion);
            }
        }

        void KillAttitudeO_Click(object sender, EventArgs e)
        {
            GetDialog hostmask = new GetDialog("Nick/Hostmask:");
            if (hostmask.ShowDialog() == DialogResult.OK)
            {
                em.Clients[em.activeServer].WriteLine("kill " + hostmask.Answer + " " + banattitude);
            }
        }

        void KillSpamBotsTrojansO_Click(object sender, EventArgs e)
        {
            GetDialog hostmask = new GetDialog("Nick/Hostmask:");
            if (hostmask.ShowDialog() == DialogResult.OK)
            {
                em.Clients[em.activeServer].WriteLine("kill " + hostmask.Answer + " " + banspambot);
            }
        }

        void KillFloodO_Click(object sender, EventArgs e)
        {
            GetDialog hostmask = new GetDialog("Nick/Hostmask:");
            if (hostmask.ShowDialog() == DialogResult.OK)
            {
                em.Clients[em.activeServer].WriteLine("kill " + hostmask.Answer + " " + banflood);
            }
        }
        #endregion
        #endregion
        #endregion
        #region Modes and Changes
        void chgIdent_Click(object sender, EventArgs e)
        {
            GetDialog getText = new GetDialog("nick and ident <Example:Bubba NotBubba>");
            if (getText.ShowDialog() == DialogResult.OK)
            {
                em.Clients[em.activeServer].WriteLine("chgname " + getText.Answer);
            }
        }

        void chgname_Click(object sender, EventArgs e)
        {
            GetDialog getText = new GetDialog("nick and name <Example:Bubba TechAdmin on SomeNet>");
            if (getText.ShowDialog() == DialogResult.OK)
            {
                em.Clients[em.activeServer].WriteLine("chgname " + getText.Answer);
            }
        }

        void CHGhost_Click(object sender, EventArgs e)
        {
            GetDialog getText = new GetDialog("nick and newhost <Example:Bubba code.slashdot.org>");
            if (getText.ShowDialog() == DialogResult.OK)
            {
                em.Clients[em.activeServer].WriteLine("chghost " + getText.Answer);
            }
        }

        void SetIdent_Click(object sender, EventArgs e)
        {
            GetDialog getText = new GetDialog("new ident <Example:Bubba>");
            if (getText.ShowDialog() == DialogResult.OK)
            {
                em.Clients[em.activeServer].WriteLine("setident " + getText.Answer);
            }
        }

        void SetHost_Click(object sender, EventArgs e)
        {
            GetDialog getText = new GetDialog("Set Host");
            if (getText.ShowDialog() == DialogResult.OK)
            {
                em.Clients[em.activeServer].WriteLine("sethost " + getText.Answer);
            }
        }
        #endregion
    }

    public class StatsRawCapture : OnRaw
    {
        #region OnRaw Members

        public void Execute(NasuTek.Shion.Agent.IrcEventArgs e, ExtencibilityManager em)
        {
            if (e.Data.ReplyCode == NasuTek.Shion.Agent.ReplyCode.StatsText)
            {
                em.ConsoleWrite(em.activeServer, e.Data.RawMessage);
            }
            else if (e.Data.ReplyCode == NasuTek.Shion.Agent.ReplyCode.EndOfStats)
            {
                em.ConsoleWrite(em.activeServer, "End of /STATS report");
            }
        }

        #endregion
    }

    public class OperRawCapture : OnRaw
    {
        #region OnRaw Members

        public void Execute(NasuTek.Shion.Agent.IrcEventArgs e, ExtencibilityManager em)
        {

        }

        #endregion
    }
}